package com.ibeeking.found.msg.rest.controller.v1;

import com.alibaba.nacos.common.http.param.MediaType;
import com.ibeeking.found.msg.rest.service.IWxCpMsgTemplateService;
import com.ibeeking.found.msg.service.common.query.WxCpMsgTemplateQuery;
import com.ibeeking.found.msg.service.common.vo.WxCpMsgTemplateVO;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName MpTemplateMsgController控制器
 * @Description
 * @Author ibeeking
 * @Date 2020-12-30 14:12
 **/
@RestController
@RequestMapping("/msg/wxCpMsgTemplate/v1")
public class WxCpMsgTemplateController {

    @Resource
    private IWxCpMsgTemplateService wxCpMsgTemplateServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询微信公众号模板消息列表")
    @PostMapping(value = "/queryTemplateList", produces = MediaType.APPLICATION_JSON)
    public List<WxCpMsgTemplateVO> queryTemplateList(@RequestBody WxCpMsgTemplateQuery query) {
        return wxCpMsgTemplateServiceImpl.list(query);
    }
}
